From 77d9437e2812baad3e09ac344dd419d2ffada675 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Mon, 29 Apr 2024 16:02:11 +0200 Subject: [PATCH] Cherry-pick patch from upstream to fix issue with newer expat and appended data. Closes: #1064762 --- debian/changelog | 7 +++- debian/patches/09_newer_expat.patch | 64 +++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 debian/patches/09_newer_expat.patch diff --git a/debian/changelog b/debian/changelog index 3925313e4..031ec3f08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,14 @@ -vtk9 (9.1.0+really9.1.0+dfsg2-8) unreleased; urgency=medium +vtk9 (9.1.0+really9.1.0+dfsg2-8) UNRELEASED; urgency=medium + [ Bo YU ] * Team upload. * Add support for loongarch64. Thanks to Dandan Zhang . (Closes: #1054471) + [ Michael R. Crusoe ] + * Cherry-pick patch from upstream to fix issue with newer expat and + appended data. Closes: #1064762 + -- Bo YU Tue, 24 Oct 2023 14:35:29 +0800 vtk9 (9.1.0+really9.1.0+dfsg2-7.1) unstable; urgency=medium diff --git a/debian/patches/09_newer_expat.patch b/debian/patches/09_newer_expat.patch new file mode 100644 index 000000000..1894d75ba --- /dev/null +++ b/debian/patches/09_newer_expat.patch @@ -0,0 +1,64 @@ +From: Ben Boeckel +Date: Mon, 15 Apr 2024 22:22:22 -0400 +Subject: vtkXMLDataParser: track `AppendedData` state explicitly +Bug-Debian: https://bugs.debian.org/1064762 +Origin: upstream,https://gitlab.kitware.com/vtk/vtk/-/commit/3efa07ad277efe5c1d11a2ef2b907c095f68bbef +Forwarded: not-needed + +Newer `libexpat` doesn't like being given the appended data after the +artificially ended document anymore. Avoid pushing it through to its +parser. + +--- + IO/XMLParser/vtkXMLDataParser.cxx | 6 +++++- + IO/XMLParser/vtkXMLDataParser.h | 3 +++ + 2 files changed, 8 insertions(+), 1 deletion(-) + +--- vtk9.orig/IO/XMLParser/vtkXMLDataParser.cxx ++++ vtk9/IO/XMLParser/vtkXMLDataParser.cxx +@@ -47,6 +47,7 @@ + this->RootElement = nullptr; + this->AppendedDataPosition = 0; + this->AppendedDataMatched = 0; ++ this->AppendedDataFound = false; + this->DataStream = nullptr; + this->InlineDataStream = vtkBase64InputStream::New(); + this->AppendedDataStream = vtkBase64InputStream::New(); +@@ -99,6 +100,7 @@ + { + this->Superclass::PrintSelf(os, indent); + os << indent << "AppendedDataPosition: " << this->AppendedDataPosition << "\n"; ++ os << indent << "AppendedDataFound: " << this->AppendedDataFound << "\n"; + if (this->RootElement) + { + this->RootElement->PrintXML(os, indent); +@@ -227,7 +229,7 @@ + // If we have reached the appended data section, we stop parsing. + // This prevents the XML parser from having to walk over the entire + // appended data section. +- if (this->AppendedDataPosition) ++ if (this->AppendedDataPosition || this->AppendedDataFound) + { + return 1; + } +@@ -448,6 +450,8 @@ + { + return 0; + } ++ ++ this->AppendedDataFound = true; + } + + return 1; +--- vtk9.orig/IO/XMLParser/vtkXMLDataParser.h ++++ vtk9/IO/XMLParser/vtkXMLDataParser.h +@@ -215,6 +215,9 @@ + // How much of the string "